package com.atguigu.hellomp.util;

import io.minio.MinioClient;
import io.minio.ObjectWriteResponse;
import io.minio.UploadObjectArgs;
import io.minio.errors.*;

import java.io.IOException;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;

public class MyMinio {

    public static void main(String[] args) throws IOException, ServerException, InsufficientDataException, ErrorResponseException, NoSuchAlgorithmException, InvalidKeyException, InvalidResponseException, XmlParserException, InternalException {
        MinioClient minioClient = MinioClient.builder()
                .endpoint("http://192.168.171.99:9000")
                .credentials("minioadmin","minioadmin")
                .build();

        UploadObjectArgs uploadObjectArgs = UploadObjectArgs.builder()
                .bucket("lease")
                .filename("C:\\Users\\asus\\Desktop\\前端\\img\\芙莉莲.jpg")
                .object("芙莉莲.jpg")
                .build();
       minioClient.uploadObject(uploadObjectArgs);
    }
}
